home *** CD-ROM | disk | FTP | other *** search
/ Let's Learn About Machines / Let's Learn About Machines.iso / mac / macfiles / Work / plane.Dxr / 00003.ls < prev    next >
Encoding:
Text File  |  1997-09-18  |  5.1 KB  |  159 lines

  1. on mouseDown
  2.   global clickH, clickNum
  3.   set clickH to the locH of sprite the clickOn
  4.   if (clickH > 20) and (clickH < 26) then
  5.     set clickNum to 1
  6.   else
  7.     if (clickH > 60) and (clickH < 70) then
  8.       set clickNum to 2
  9.     else
  10.       if (clickH > 101) and (clickH < 112) then
  11.         set clickNum to 3
  12.       else
  13.         if (clickH > 145) and (clickH < 152) then
  14.           set clickNum to 4
  15.         else
  16.           if (clickH > 185) and (clickH < 196) then
  17.             set clickNum to 5
  18.           else
  19.             if (clickH > 226) and (clickH < 238) then
  20.               set clickNum to 6
  21.             else
  22.               if (clickH > 270) and (clickH < 280) then
  23.                 set clickNum to 7
  24.               else
  25.                 if (clickH > 312) and (clickH < 324) then
  26.                   set clickNum to 8
  27.                 else
  28.                   if (clickH > 354) and (clickH < 364) then
  29.                     set clickNum to 9
  30.                   else
  31.                     if (clickH > 396) and (clickH < 406) then
  32.                       set clickNum to 10
  33.                     else
  34.                       if (clickH > 438) and (clickH < 448) then
  35.                         set clickNum to 11
  36.                       else
  37.                         if (clickH > 475) and (clickH < 495) then
  38.                           set clickNum to 12
  39.                         else
  40.                           if (clickH > 522) and (clickH < 532) then
  41.                             set clickNum to 13
  42.                           end if
  43.                         end if
  44.                       end if
  45.                     end if
  46.                   end if
  47.                 end if
  48.               end if
  49.             end if
  50.           end if
  51.         end if
  52.       end if
  53.     end if
  54.   end if
  55.   repeat while the stillDown
  56.     set the locV of sprite the clickOn to the mouseV
  57.     set the locH of sprite the clickOn to the mouseH
  58.     updateStage()
  59.   end repeat
  60. end
  61.  
  62. on mouseUp
  63.   global spritew1, spritew2, spritew3, spritew4, spritew5, spritew6, clickH, clickNum, spritew7, spritew8, spritew9, spritew10, spritew11, spritew12, spritew13
  64.   if (the clickOn > 32) and (the clickOn < 46) then
  65.     if the locH of sprite the clickOn > 540 then
  66.       set the locH of sprite the clickOn to 569
  67.       set the locV of sprite the clickOn to 432
  68.       updateStage()
  69.       wait(5)
  70.       set x to 0
  71.       repeat while (clickNum + x) < 13
  72.         set x to x + 1
  73.         repeat with d = 1 to 6
  74.           set the locH of sprite value("spritew" & clickNum + x) to the locH of sprite value("spritew" & clickNum + x) - 7
  75.           set the locV of sprite the clickOn to 432
  76.           updateStage()
  77.         end repeat
  78.       end repeat
  79.       repeat with d = 1 to 6
  80.         set the locH of sprite the clickOn to the locH of sprite the clickOn - 7
  81.         set the locV of sprite the clickOn to 432
  82.         updateStage()
  83.       end repeat
  84.       set temphold to spritew13
  85.       set spritew13 to value("spritew" & clickNum)
  86.       set switchnum to 13
  87.       repeat while switchnum > clickNum
  88.         set switchnum to switchnum - 1
  89.         set temphold2 to value("spritew" & switchnum)
  90.         if switchnum = 12 then
  91.           set spritew12 to temphold
  92.         else
  93.           if switchnum = 11 then
  94.             set spritew11 to temphold
  95.           else
  96.             if switchnum = 10 then
  97.               set spritew10 to temphold
  98.             else
  99.               if switchnum = 9 then
  100.                 set spritew9 to temphold
  101.               else
  102.                 if switchnum = 8 then
  103.                   set spritew8 to temphold
  104.                 else
  105.                   if switchnum = 7 then
  106.                     set spritew7 to temphold
  107.                   else
  108.                     if switchnum = 6 then
  109.                       set spritew6 to temphold
  110.                     else
  111.                       if switchnum = 5 then
  112.                         set spritew5 to temphold
  113.                       else
  114.                         if switchnum = 4 then
  115.                           set spritew4 to temphold
  116.                         else
  117.                           if switchnum = 3 then
  118.                             set spritew3 to temphold
  119.                           else
  120.                             if switchnum = 2 then
  121.                               set spritew2 to temphold
  122.                             else
  123.                               if switchnum = 1 then
  124.                                 set spritew1 to temphold
  125.                               end if
  126.                             end if
  127.                           end if
  128.                         end if
  129.                       end if
  130.                     end if
  131.                   end if
  132.                 end if
  133.               end if
  134.             end if
  135.           end if
  136.         end if
  137.         set temphold to temphold2
  138.       end repeat
  139.       checkwin()
  140.     else
  141.       set the locH of sprite the clickOn to clickH
  142.       set the locV of sprite the clickOn to 432
  143.       updateStage()
  144.     end if
  145.   end if
  146. end
  147.  
  148. on checkwin
  149.   global tagOrder
  150.   set word1 to EMPTY
  151.   repeat with r = 1 to 13
  152.     set word1 to word1 & the name of cast the castNum of sprite value("spritew" & r)
  153.   end repeat
  154.   set tagOrder to word1
  155.   if word1 = "inclinedplane" then
  156.     go(10)
  157.   end if
  158. end
  159.